package homework_1.Bank;

/**
 * @author 朱
 * @date 2019031421:02
 */
public class Bank {
    static String bankName;//银行名字//
    private String name;//用户名字//
    private String password;//密码//
    private double balance;//余额//
    private double turnover;//交易额//

    static void welcome(){
        System.out.println("欢迎来到"+bankName+"------");
    }
    public Bank(String name, String passwoed,  double turnover) {
        this.name = name;
        this.password = passwoed;
        this.balance = turnover-10;
        this.turnover = turnover;
        System.out.println(name+" 开户成功，存入"+turnover+"账户余额"+balance);
    }
    public Bank(){}
    void deposit(String passwoed,double turnover){
        balance=turnover+balance;
        System.out.println(name+"您好， 您的账户 已存入"+turnover+"元，当前余额："+balance);

    }

    void withdrawal(String pass,double turnover){
        if (pass.equals(password)){
            if (turnover>balance){
                System.out.println("对不起，账户余额不足！");
            }else {
                System.out.println(name+" 您好，您的账户已取出"+turnover+"元，当前余额"+(balance-turnover)+"元");
                System.out.println("请携带好随身财产，欢迎下次光临"+bankName);
            }
        }else {
            System.out.println("您输入的密码错误！");
        }
    }
}

